#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>


int main(int argc, char const *argv[])
{
    pid_t pid = fork();
    if (pid == 0)
    {
        char *path = "/home/ljt/桌面/code_vs/09_day2review/other";
        char *argv[] = {path,"abc", NULL};
        char *envp[] = {NULL};
        int result = execve(path,argv,envp);
        if(result == -1){
            perror("execve");

        }else{
            printf("execve success\n");

        }
        printf("子进程%d\n", getpid());
    }else if (pid > 0){
        sleep(1);
        printf("父进程%d\n", getpid());
    }
    
    return 0;
}
